﻿<%@ Page Title="" Language="VB" MasterPageFile="~/inventory/MasterInv.master" AutoEventWireup="false" CodeFile="addinv.aspx.vb" Inherits="inventory_addinv" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td class="Column1" colspan="2"><h4 style="text-align: center">Add Hardware and Software Information</h4></td>
                </tr>
                <tr>
                    <td class="Column1">Company :</td>
                    <td>
                        <asp:DropDownList ID="DropDownList1" runat="server" CssClass="selection" DataSourceID="SQLCompany" DataTextField="company" DataValueField="company">
                            <asp:ListItem Selected="True">Select</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Processor :</td>
                    <td>
                        <asp:TextBox ID="txtProcessor" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">RAM :</td>
                    <td>
                        <asp:TextBox ID="txtRAM" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Unit Model :</td>
                    <td>
                        <asp:TextBox ID="txtUnitModel" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">VGA :</td>
                    <td>
                        <asp:TextBox ID="txtVGA" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Storage Capacity :</td>
                    <td>
                        <asp:TextBox ID="txtStorage" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Optical Media :</td>
                    <td>
                        <asp:TextBox ID="txtOptical" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Mac Address :</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="txtMacAddress" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Serial No. :</td>
                    <td>
                        <asp:TextBox ID="txtSerial" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Status :</td>
                    <td>
                        <asp:DropDownList ID="selectstatus" runat="server" CssClass="selection">
                            <asp:ListItem>Working</asp:ListItem>
                            <asp:ListItem Selected="True">Pending</asp:ListItem>
                            <asp:ListItem>Storage</asp:ListItem>
                            <asp:ListItem>Disposal</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Operating System :</td>
                    <td>
                        <asp:TextBox ID="txtOS" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Local User :</td>
                    <td>
                        <asp:TextBox ID="txtLocalUser" runat="server" CssClass="textbox"></asp:TextBox>
                        <br />
                        <asp:CheckBox ID="CheckBox2" runat="server" Text="Local Admin" />
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Local User Password :</td>
                    <td>
                        <asp:TextBox ID="txtLocalUserPassword" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Local Admin :</td>
                    <td>
                        <asp:TextBox ID="txtLocalAdmin" runat="server" CssClass="textbox" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Local Admin Password :</td>
                    <td>
                        <asp:TextBox ID="txtLocalAdminPassword" runat="server" CssClass="textbox" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Department :</td>
                    <td>
                        <asp:TextBox ID="txtDepartment" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Software Installed :</td>
                    <td>
                        <asp:TextBox ID="txtSoftwares" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Word Processing :</td>
                    <td>
                        <asp:TextBox ID="txtWord" runat="server" CssClass="textbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">Remarks :</td>
                    <td>
                        <asp:TextBox ID="txtremarks" runat="server" TextMode="MultiLine" CssClass="multitextbox"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="Column1">&nbsp;</td>
                    <td>
                        <asp:Button ID="Button1" runat="server" Text="Add to Inventory" />
                    </td>
                </tr>
            </table>
            <br />
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:SqlDataSource ID="SQLCompany" runat="server" ConnectionString="<%$ ConnectionStrings:inventorydatabase %>" SelectCommand="SELECT * FROM [inv_company] WHERE ([AssignedAgent] = @AssignedAgent)">
                <SelectParameters>
                    <asp:SessionParameter Name="AssignedAgent" SessionField="logged" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SQLHardware" runat="server" ConnectionString="<%$ ConnectionStrings:inventorydatabase %>" DeleteCommand="DELETE FROM [inv_HardwareDetails] WHERE [hardwareID] = @hardwareID" InsertCommand="INSERT INTO [inv_HardwareDetails] ([hardwareID], [Processor], [RAM], [Model], [VGA], [Capacity], [Optical_Media], [MacAddress], [Serial], [Active], [DateInput]) VALUES (@hardwareID, @Processor, @RAM, @Model, @VGA, @Capacity, @Optical_Media, @MacAddress, @Serial, @Active, @DateInput)" SelectCommand="SELECT * FROM [inv_HardwareDetails]" UpdateCommand="UPDATE [inv_HardwareDetails] SET [Processor] = @Processor, [RAM] = @RAM, [Model] = @Model, [VGA] = @VGA, [Capacity] = @Capacity, [Optical_Media] = @Optical_Media, [MacAddress] = @MacAddress, [Serial] = @Serial, [Active] = @Active, [DateInput] = @DateInput WHERE [hardwareID] = @hardwareID">
                <DeleteParameters>
                    <asp:Parameter Name="hardwareID" Type="Int64" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:SessionParameter Name="hardwareID" SessionField="hardwareid" Type="Int64" />
                    <asp:ControlParameter ControlID="txtProcessor" Name="Processor" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtRAM" Name="RAM" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtUnitModel" Name="Model" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtVGA" Name="VGA" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtStorage" Name="Capacity" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtOptical" Name="Optical_Media" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtMacAddress" Name="MacAddress" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtSerial" Name="Serial" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="selectstatus" Name="Active" PropertyName="SelectedValue" Type="String" />
                    <asp:SessionParameter Name="DateInput" SessionField="datenow" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Processor" Type="String" />
                    <asp:Parameter Name="RAM" Type="String" />
                    <asp:Parameter Name="Model" Type="String" />
                    <asp:Parameter Name="VGA" Type="String" />
                    <asp:Parameter Name="Capacity" Type="String" />
                    <asp:Parameter Name="Optical_Media" Type="String" />
                    <asp:Parameter Name="MacAddress" Type="String" />
                    <asp:Parameter Name="Serial" Type="String" />
                    <asp:Parameter Name="Active" Type="String" />
                    <asp:Parameter Name="DateInput" Type="String" />
                    <asp:Parameter Name="hardwareID" Type="Int64" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SQLSoftware" runat="server" ConnectionString="<%$ ConnectionStrings:inventorydatabase %>" DeleteCommand="DELETE FROM [inv_softwareDetails] WHERE [softwareid] = @softwareid" InsertCommand="INSERT INTO [inv_softwareDetails] ([softwareid], [OS], [LocalAdmin], [LocalAdminPassword], [Department], [LocalUser], [LocalUserpassword], [SoftwareInstalled], [WordProcessing], [Remarks]) VALUES (@softwareid, @OS, @LocalAdmin, @LocalAdminPassword, @Department, @LocalUser, @LocalUserpassword, @SoftwareInstalled, @WordProcessing, @Remarks)" SelectCommand="SELECT * FROM [inv_softwareDetails]" UpdateCommand="UPDATE [inv_softwareDetails] SET [OS] = @OS, [LocalAdmin] = @LocalAdmin, [LocalAdminPassword] = @LocalAdminPassword, [Department] = @Department, [LocalUser] = @LocalUser, [LocalUserpassword] = @LocalUserpassword, [SoftwareInstalled] = @SoftwareInstalled, [WordProcessing] = @WordProcessing, [Remarks] = @Remarks WHERE [softwareid] = @softwareid">
                <DeleteParameters>
                    <asp:Parameter Name="softwareid" Type="Int64" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:SessionParameter Name="softwareid" SessionField="softwareid" Type="Int64" />
                    <asp:ControlParameter ControlID="txtOS" Name="OS" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtLocalAdmin" Name="LocalAdmin" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtLocalAdminPassword" Name="LocalAdminPassword" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtDepartment" Name="Department" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtLocalUser" Name="LocalUser" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtLocalUserPassword" Name="LocalUserpassword" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtSoftwares" Name="SoftwareInstalled" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtWord" Name="WordProcessing" PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="txtremarks" Name="Remarks" PropertyName="Text" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="OS" Type="String" />
                    <asp:Parameter Name="LocalAdmin" Type="String" />
                    <asp:Parameter Name="LocalAdminPassword" Type="String" />
                    <asp:Parameter Name="Department" Type="String" />
                    <asp:Parameter Name="LocalUser" Type="String" />
                    <asp:Parameter Name="LocalUserpassword" Type="String" />
                    <asp:Parameter Name="SoftwareInstalled" Type="String" />
                    <asp:Parameter Name="WordProcessing" Type="String" />
                    <asp:Parameter Name="Remarks" Type="String" />
                    <asp:Parameter Name="softwareid" Type="Int64" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="UnitKey" runat="server" ConnectionString="<%$ ConnectionStrings:inventorydatabase %>" DeleteCommand="DELETE FROM [inv_HardwareKey] WHERE [hardwareid] = @hardwareid" InsertCommand="INSERT INTO [inv_HardwareKey] ([hardwareid], [softwarekey], [company], [dateadded], [uploadedby]) VALUES (@hardwareid, @softwarekey, @company, @dateadded, @uploadedby)" SelectCommand="SELECT * FROM [inv_HardwareKey]" UpdateCommand="UPDATE [inv_HardwareKey] SET [softwarekey] = @softwarekey, [company] = @company, [dateadded] = @dateadded, [uploadedby] = @uploadedby WHERE [hardwareid] = @hardwareid">
                <DeleteParameters>
                    <asp:Parameter Name="hardwareid" Type="Int64" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:SessionParameter Name="hardwareid" SessionField="hardwareid" Type="Int64" />
                    <asp:SessionParameter Name="softwarekey" SessionField="softwareid" Type="Int64" />
                    <asp:ControlParameter ControlID="DropDownList1" Name="company" PropertyName="SelectedValue" Type="String" />
                    <asp:SessionParameter Name="dateadded" SessionField="datenow" Type="String" />
                    <asp:SessionParameter Name="uploadedby" SessionField="logged" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="softwarekey" Type="Int64" />
                    <asp:Parameter Name="company" Type="String" />
                    <asp:Parameter Name="dateadded" Type="String" />
                    <asp:Parameter Name="uploadedby" Type="String" />
                    <asp:Parameter Name="hardwareid" Type="Int64" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
    <style type="text/css" style="vertical-align: top">
        .auto-style1 {
            height: 22px;
        }
        .Column1 {
        text-align:right;
        white-space:nowrap;
        vertical-align:text-top;
        width:20%;
        }
        .box {
        background-color :#F0F0F0;
    left:30%;
    vertical-align: middle; 
    white-space: nowrap;
    width:60%;
    overflow:scroll ;
}
        .textbox {
            width: 70%;
            height: 16px;
        }
        .multitextbox {
width : 70%;
height:42px;

        }
        .selection {
width : 70%;
height:20px;
        }
    </style>
</asp:Content>

